import type { App, Plugin } from 'vue';

export const withInstall = <T>(comp: T) => {
  const data = comp as any;
  data.install = function bar(app: App) {
    app.component(data.displayName || data.name, comp);
  };

  return comp as T & Plugin;
};
